import Vue from 'vue'
import App from './App'
import './global'
import '@/permission' // permission control
import router from './router/index'
import store from './store'

import config from '@/defaultSettings'
import {
  ACCESS_TOKEN
} from '@/store/mutation-types'
// eslint-disable-next-line no-unused-vars
const vue = new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>',
  mounted () {
    store.commit('SET_SIDEBAR_TYPE', true)
    store.commit('TOGGLE_THEME', config.navTheme)
    store.commit(
      'TOGGLE_LAYOUT_MODE', config.layout
    )
    store.commit(
      'TOGGLE_FIXED_HEADER',
      config.fixedHeader
    )
    store.commit(
      'TOGGLE_FIXED_SIDERBAR', config.fixSiderbar
    )
    store.commit(
      'TOGGLE_CONTENT_WIDTH', config.contentWidth
    )
    store.commit(
      'TOGGLE_FIXED_HEADER_HIDDEN', config.autoHideHeader
    )
    store.commit(
      'TOGGLE_WEAK', config.colorWeak
    )
    store.commit('TOGGLE_COLOR', config.primaryColor)
    store.commit('SET_TOKEN', ACCESS_TOKEN)
    store.commit(
      'SET_MULTI_PAGE', config.multipage
    )
  }
})
